$pageTitle="Member First Use"; include($_SERVER['DOCUMENT_ROOT'] . "/template/header.php"); $error=false; //get the username variable if($_GET['u'] && $_GET['t']){ //get the username and timestamp $username=$_GET['u']; $datetime=strrev($_GET['t']); $result=database_query("SELECT username FROM Members WHERE username='$u' LIMIT 1"); if(mysql_num_rows($result)!=0){ $queryString="SELECT id, username, name, category, status, created FROM Members WHERE username='$u' AND created='$datetime' LIMIT 1"; } else{ echo "
The member information provided wasn't accurate. Please fill out the form to try again.
\n"; $error=true; } } elseif($_GET['u'] && $_GET['p']){ //get the username and password $username=$_GET['u']; $password=$_GET['p']; $result=database_query("SELECT username FROM Members WHERE username='$u' LIMIT 1"); if(mysql_num_rows($result)!=0){ $queryString="SELECT id, username, name, category, status, created FROM Members WHERE username='$u' AND password=MD5('$datetime') LIMIT 1"; } else{ echo "The member information provided wasn't accurate. Please fill out the form to try again.
\n"; $error=true; } } else{ echo "There was no member provided. This is probably a technical problem. Try entering a username and password.
\n"; $error=true; } if($error){ ?> include($_SERVER['DOCUMENT_ROOT'] . "/template/footer.php"); exit(); } else{ //if we get here then we need to run the query and get the user's info $result=database_query($queryString); if($result && mysql_num_rows($result)==1){ //we got the user's info so let's check it $myrow=mysql_fetch_row($result); echo "Membership Registration For $myrow[2]
\n"; echo "Username: $myrow[1]
\n"; if($myrow[3]==0){ echo "Category: You haven't selected a category for yourself yet. You can do that in your member profile after this page.
\n"; } else{ echo "Category: You have selected a category for yourself. You chose $myrow[3]. You can change this in your member profile after this page.
\n"; } if($myrow[4]==0){ echo "Status: Activating your membership now...
\n"; $result=database_query("UPDATE Members SET status = 1 WHERE id=$myrow[0]"); if($result){ echo "Status: Your membership has now been activated. Thanks for joining.
\n"; $userActive=true; } else{ echo "Status: Sorry, but we were unable to activate your membership, this is a technical problem. Please try again in a little bit.
\n"; } } else{ echo "Status: Your status is currently active.
\n"; } echo "What would you like to do?
\n"; echo "\n"; } } else{ //database failure echo "There was a technical problem. We apologize. Please try again in a bit.
\n"; $error=true; } } include($_SERVER['DOCUMENT_ROOT'] . "/template/footer.php"); ?>